package zhuoer.adv2;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class BuffWRiterTest {

	public static void main(String[] args) {
		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter(
					"e:/a/chat.txt"));
			Scanner sc = new Scanner(System.in);
			String str = "";
			while (!(str = sc.next()).equals("quit")) {
				bw.write(str);
				bw.newLine();// 换行
			}
			bw.close();
		} catch (IOException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

	}
}
